import socket
tcp_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
tcp_socket.connect(('192.168.0.107',8080))
while True:
    mess = input('请输入你要发送的数据：')
    if mess:
        tcp_socket.send(mess.encode('utf-8'))
    else:
        break
    data = tcp_socket.recv(1024)
    print(data.decode('utf-8'))
tcp_socket.close()